<template>
	<view>
		<v-leaflet ref="gdleafletwx"></v-leaflet>
	</view>
</template>

<script>
	var L = require('../../wxcomponents/zhgeo/leafletwx')
	import {createMap} from '../../wxcomponents/zhgeo/base.map'
	import {DefaultIcons} from '../../wxcomponents/zhgeo/config.js';
	const defaultIcons = new DefaultIcons();
	
	export default {
		data() {
			return {
				
			}
		},
		onLoad() {
			// const container = this.selectComponent('#gd-leafletwx')
			const container = this.$refs.gdleafletwx
			let min_zoom = 10
			let max_zoom = 18
			createMap(container,  {
				minZoom: min_zoom,
				maxZoom: max_zoom,
			  }, function(map) {
			  L.tileLayer('http://webrd0{s}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}', { subdomains: "1234" }).addTo(map),
			  map.setView([31.294516,120.625814], 18);
			  // 添加marker
			  let m = L.marker([31.2948516,120.625814], {
				src: defaultIcons.locationNow,
				width: 32,
				height: 32,
				showInCenter: false,
			  }).addTo(map);
			  // 删除marer
			  // map.removeLayer( m );
			});
		},
		methods: {
			
		}
	}
</script>

<style>

</style>
